package friendsbtt.servlets;

import com.google.gdata.client.photos.PicasawebService;

import friendsbtt.core.Log;
import friendsbtt.core.Settings;
import friendsbtt.core.lang.ResourceResolver;
import friendsbtt.core.lang.TypeResolver;
import friendsbtt.core.services.GalleryWebClientFactory;
import friendsbtt.core.services.IGalleryWebClient;
import friendsbtt.core.services.PicasawebClient;
import friendsbtt.utils.Gallery;
import friendsbtt.utils.IGallery;

public class Bootstrapper {
	public static void Start(){
		Log.info("Bootstrapping the app...");
		Log.info("Application name: " + Settings.getApplicationSettings().get("applicationname"));
		ResourceResolver.add(new TypeResolver<PicasawebService>(new PicasawebService(Settings.getApplicationSettings().get("applicationname"))));
		ResourceResolver.add(new TypeResolver<IGalleryWebClient>(IGalleryWebClient.class, GalleryWebClientFactory.Create()));
		ResourceResolver.add(new TypeResolver<IGallery>(IGallery.class, new Gallery((IGalleryWebClient)ResourceResolver.get(IGalleryWebClient.class))));
	}
}
